package com.wenli.graduate2022.wenliGreenShop.service.servImpl;

import com.wenli.graduate2022.wenliGreenShop.entity.ProductOrderItem;
import com.wenli.graduate2022.wenliGreenShop.entity.ShoppingCart;
import com.wenli.graduate2022.wenliGreenShop.repository.mapper.ShoppingCartMapper;
import com.wenli.graduate2022.wenliGreenShop.service.servDao.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author HuangHai
 * @date 2022/5/2 19:01
 */
@Service
public class ShoppingCartServImpl implements ShoppingCartService {

    @Autowired
    ShoppingCartMapper shoppingCartMapper;

    @Override
    public ShoppingCart findById(Integer id) {
        return shoppingCartMapper.findById(id);
    }

    @Override
    public List<ShoppingCart> findByUserId(Integer id) {
        return shoppingCartMapper.findByUserId(id);
    }

    @Override
    public int addShoppingCart(ShoppingCart shoppingCart) {
        return  shoppingCartMapper.addShoppingCart(shoppingCart);
    }

    @Override
    public int updateShoppingCart(ShoppingCart shoppingCart) {
        return shoppingCartMapper.updateShoppingCart(shoppingCart);
    }

    @Override
    public int deleteShoppingCart(Integer shoppingCartId) {
        return shoppingCartMapper.deleteShoppingCart(shoppingCartId);
    }
}
